package com.manager.system.controller;

import com.manager.common.utils.DataTools;
import com.manager.common.vo.ResultVO;
import com.manager.model.FirstPageState;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName FirstPageController
 * @Description TODO
 * @Author @LiuHongJun
 * @Date 2025/9/11 20:44
 * @Version 1.0
 */
@RestController
@RequestMapping("/first")
public class FirstPageController {

    @RequestMapping("/getFirstPageGatherData")
    public ResultVO getFirstPageGatherData(String type) {
        try{
            JSONArray firstPageState = DataTools.getCacheData(type);
            firstPageState = firstPageState == null?  new JSONArray() : firstPageState;
            return ResultVO.success(firstPageState);
        }catch (Exception e){
            e.printStackTrace();
        }
        return ResultVO.success(new FirstPageState());
    }
}
